package com.cskaoyan.controller.wx;

import com.cskaoyan.bean.vo.BaseRespVo;
import com.cskaoyan.bean.vo.WxRegionListVo;
import com.cskaoyan.service.RegionListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Description: region获取地址：省、市、区
 * @Author: chaohe@com.cskaoyan、zoey-zhu
 * @Date: 2021/7/8
 * @Time: 19:59
 */
//行政区域
@RestController
@RequestMapping("wx/region")
public class WxRegionController {

    @Autowired
    RegionListService regionListService;

   /**
    * @Author: zoey-zhu
    * @description: 小程序region获取地址：省、市、区
    * @Date: 15:28 2021/7/12
    * @url: http://182.92.235.201:8083/wx/region/list?pid=0
    */
    @GetMapping("/list")
    public BaseRespVo listByPid(Integer pid) {
        List<WxRegionListVo> vxRegionVoList = regionListService.listByPid(pid);
        return BaseRespVo.ok(vxRegionVoList);
    }
}